Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement/148 | Expose hooks for "avatar updated" and "avatar deleted" #149

Merged
merged 4 commits into from
Sep 6, 2022
Merged

Enhancement/148 | Expose hooks for "avatar updated" and "avatar deleted" #149

merged 4 commits into from
Sep 6, 2022

Conversation

t-lock
Copy link
Contributor

@t-lock t-lock commented Aug 31, 2022

Description of the Change

Exposes two hooks, simple_local_avatar_updated and simple_local_avatar_deleted. These hooks allow theme developers or other plugin developers to react to changes in local avatars in a consistent and precise way.

Example use cases include:

  • sharing user avatars with external services such as chat or forum add-ons
  • developing front-end flows for editing user profiles
  • any use case adjacent to user management

Closes #148

Changelog Entry

Added - Two hooks, simple_local_avatar_updated and simple_local_avatar_deleted

Credits

@t-lock

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@t-lock
Copy link
Contributor Author

t-lock commented Aug 31, 2022

I have not written a test scenario for this, but its totally understandable if that is a prerequisite for considering this PR, just let me know.

Thanks for your work on this plugin, excited to be able to pull the upstream back into my project if the team agrees this functionality is worth including in Simple Local Avatars.

@t-lock
Copy link
Contributor Author

t-lock commented Aug 31, 2022

Also, I wasn't sure where to add documentation, apologies if that was something obvious I missed. Happy to add if someone can point me in the right direction.

@jeffpaul jeffpaul added this to the 2.6.0 milestone Aug 31, 2022
Copy link
Member

@faisal-alvi faisal-alvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few PHPCS issues.

includes/class-simple-local-avatars.php Outdated Show resolved Hide resolved
includes/class-simple-local-avatars.php Outdated Show resolved Hide resolved
@faisal-alvi
Copy link
Member

@dkotter Code LGTM, any feedback from your end?

faisal-alvi
faisal-alvi previously approved these changes Sep 2, 2022
@t-lock
Copy link
Contributor Author

t-lock commented Sep 5, 2022

@dkotter

If that could be added to this action and the other one, that would be great

Inline documentation added. Note: I added @since 2.6.0 assuming that this would be included in the next release and it looks like the project isn't releasing 2.x.x minor versions.

Thanks!

cc @faisal-alvi

@t-lock t-lock requested a review from dkotter September 5, 2022 06:27
@dkotter dkotter merged commit aa1b65f into 10up:develop Sep 6, 2022
@t-lock t-lock deleted the Enhancement/148 branch September 7, 2022 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add hooks for "avatar updated" and "avatar deleted", to make SLA more "pluggable" in the WP ecosystem.
4 participants